<?php 
header('Content-Type:text/html; charset=windows-874');

$check_faculty_id = $_POST['check_faculty_id'];
$check_major_id = $_POST['check_major_id'];

include 'connect.php';

$sqls = "use eiso ";
$sqls .= " select * from major_profile ";
$sqls .= " where faculty_id = ".$check_faculty_id;

$result = mssql_query($sqls);

?>

<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />

<select id="re_diploma_stu_major" name="re_diploma_stu_major">
	<?php while($rs = mssql_fetch_array($result)) { ?>
		<option value="<?= $rs['major_id'] ?>"<?php if($rs['major_id'] == $check_major_id){echo "selected";}?>>- <?= $rs['major_name'] ?></option>
	<?php } ?>
</select>